﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using UnityEngine.UI;
namespace Assets
{
    public static class Log
    {
        public static GameObject obj;
        public static void init(GameObject obj)
        {
            Log.obj = obj;
        }

        public static void write(String str)
        {
            try
            {
                Debug.Log(str);
                Log.obj.GetComponent<Text>().text ="Info:"+ str;
            }
            catch (NullReferenceException e)
            {
                Debug.Log("请先使用init方法初始化对象！");
                throw e;
            }
           

        }
    }
}
